package com.zhuiyun.educations.api.collect.controller;

import com.zhuiyun.educations.api.collect.service.CollectService;
import com.zhuiyun.educations.common.response.CommonResult;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName CollectController
 * @Description TODO
 * @Author cjl
 * @Date 2023/6/26 9:25
 **/
@RestController
@RequestMapping("/collect")
public class CollectController {

    @Autowired
    CollectService collectService;
    /**
    * @Author cjl
    * @Description 查寻登录用户的收藏（视频 文章 直播）
    * @Date 2023/6/26 14:41
    * @Return com.zhuiyun.educations.common.response.CommonResult
    * @param userId
    * @param courseType
    */
    @GetMapping("/selectCollectJoinCourse")
    CommonResult selectCollectJoinCourse (Integer userId, Integer courseType) {
        return collectService.selectCollectJoinCourse(userId,courseType);
    }

    @PutMapping("/updateCollectDelFlagByUserId")
    CommonResult updateCollectDelFlagByUserId(Integer collectId){
        return collectService.updateCollectDelFlagByUserId(collectId);
    }
}
